<template>
	<view>
		<view class="list">
			<view class="item" @click="openConstructionDetails(item.id)" v-for="(item,index) in buildList" :key="index">
				<image :src="item.thumb" mode="widthFix"></image>
				<view class="title">{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			buildList:[]
		};
	},onLoad() {
		uni.request({
			url: 'https://baiyi.kent.work/api/v1/system/getConstructionList',
			method: 'POST',
			data: {
				page: 1, //页码
				limit: 10 //分页偏移量
			},
			success: res => {
				console.log(res);
				this.buildList=res.data.data.list
			}
		});
	},
	methods: {
		openConstructionDetails(id) {
			uni.navigateTo({
				url: `/pages/index/construction/details/details?id=${id}`
			});
		}
	}
};
</script>

<style lang="less" scoped>
.list {
	display: flex;
	flex-direction: column;
	box-sizing: content-box;

	.item {
		margin: 0 40rpx;
		border-radius: 12rpx;
		box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.1);
		margin-top: 40rpx;

		.title {
			text-align: center;
			padding: 20rpx 0;
			font-size: 24rpx;
		}
	}
	.item:last-child {
		margin-bottom: 40rpx;
	}
}
</style>
